import request from "@/utils/request";

// 请求用户管理列表的接口
export const asyncGetUserList = (page, limit, data) => request.get(`/admin/acl/user/${page}/${limit}`, {
    params: {
        username: data
    }
});

// 添加用户的 api
export const asyncAddUser = (data) => request.post(`/admin/acl/user/save`, data);

// 修改用户的 api
export const asyncUpDateUser = (data) => request.put(`/admin/acl/user/update`, data);

// 获取用户角色管理的 api
export const asyncGetAssign = (userId) => request.get(`/admin/acl/user/toAssign/${userId}`);

// 根据用户分配角色的 api
export const asyncDoAssign = (data) => request.post(`/admin/acl/user/doAssign`, {}, {
    params: {
        userId: data.userId,
        roleId: data.roleId.toString()
    }
});

// 删除用户的 api
export const asyncDeleteUser = (id) => request.delete(`/admin/acl/user/remove/${id}`);

// 批量删除用户的 api
export const asyncDeleteUserList = (data) => request.post(`/admin/acl/user/batchRemove`,data);